<template>
  <div>
    <input type="text" v-model="val" />
    <ul>
      <li v-for="item in getSecond" :key="item">
        {{ item }}
      </li>
    </ul>
  </div>
</template>
<style scoped>
</style>
<script>
export default {
  data() {
    return {
      arr: ["阿迪鞋子", "耐克鞋子", "鸿星尔克鞋子", "李宁鞋子"],
      val: "",
      arrNew: [{ name: "" }],
    };
  },
  methods: {},
  computed: {
    getSecond() {
      var arr = [];
      this.arr.forEach((item) => {
        if (this.val) {
          if (item.indexOf(this.val) != -1) {
            arr.push(item);
          }
        }
      });
      return arr;
    },
  },
};
</script>
